<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$host='localhost';
$user='mes';
$password='111111';
$database='mes';
$conn= mysqli_connect($host, $user, $password, $database) or die('数据库连接失败');
//$name="孔融";

//$sql="insert into sanguo (name) values ('$name')";
$sql="select * from sanguo join zi on sanguo.name=zi.name";
$res= mysqli_query($conn,$sql);
//$row= mysqli_fetch_assoc($res);
//var_dump($row);
while($row= mysqli_fetch_assoc($res)){
    echo $row['name'].'是'.$row['nation'].'势力'.'';
     echo $row['name'].'字是'.$row['last_name'].'<br>';
}

   
